Fixes #32787: Generate Doris-compatible datetime filters - #32788
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedFixes Doris Sample Data and Profiler failures by adding dedicated Doris SQLAlchemy compiler handlers for OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #32787
This PR fixes Doris Sample Data and Profiler failures caused by generating an unsupported
CAST(... AS TIMESTAMP)expression for time-based partition filters.Doris does not support
TIMESTAMPas a cast target and usesDATETIMEinstead. This change adds dedicated Doris SQLAlchemy compiler handlers for bothDatetimeAddFnandTimestampAddFn, generating:The existing MySQL compiler behavior remains unchanged.
Type of change:
High-level design:
The Doris SQLAlchemy dialect previously fell back to the generic datetime compiler, which generates
AS TIMESTAMP.This change:
pydoriscompiler handlers forDatetimeAddFnandTimestampAddFn.doris_functionthat generatesAS DATETIME.Tests:
Use cases covered
DATETIMEpartition column generates a lookback boundary usingAS DATETIME.TIMESTAMPSQLAlchemy column representation also generatesAS DATETIME.Unit tests
ingestion/tests/unit/source/database/doris/test_connection.pyDATETIMEandTIMESTAMPpartition boundaries using the actualDorisDialect.Command executed:
PYTHONPATH=ingestion/src pytest -q \ ingestion/tests/unit/topology/test_sqa_utils.py \ ingestion/tests/unit/source/database/doris/test_connection.py \ -k 'test_doris_time_partition_filter_uses_datetime_cast or test_dispatch_to_date_or_datetime'Backend integration tests
Ingestion integration tests
A live Doris integration test was not added. The regression is covered at the SQLAlchemy compilation boundary using the actual
pydorisdialect. No live Doris environment was available for this change.Playwright (UI) tests
Manual testing performed
AS TIMESTAMPand failed before the fix.DATETIMEandTIMESTAMPpaths generateAS DATETIMEafter the fix.DATE,DATETIME, andTIMESTAMPpartition expressions for the supportedYEAR,MONTH,DAY, andHOURinterval units.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes #32787: Generate Doris-compatible datetime filters.Fixes #32787above.Bug fix checklist